package com.example.loadertestapi8;

import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.LoaderManager.LoaderCallbacks;
import android.support.v4.content.CursorLoader;
import android.support.v4.content.Loader;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class MyFragment extends Fragment implements LoaderCallbacks<Cursor> {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		getLoaderManager().initLoader(0, null, this);
		return inflater.inflate(R.layout.fragment_myfragment, container, false);
	}

	@Override
	public Loader<Cursor> onCreateLoader(int arg0, Bundle arg1) {
		Log.d("TEST", "Creating loader");
		return new CursorLoader(getActivity(), Uri.parse("content://com.example.loadertestapi8/table"), null, null, null, null);
	}

	@Override
	public void onLoadFinished(Loader<Cursor> arg0, Cursor arg1) {
		Log.d("TEST", "Loader finished");
	}

	@Override
	public void onLoaderReset(Loader<Cursor> arg0) {
		
	}

}
